<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>无标题文档</title>
	</head>
	<style type="text/css">
		body {
			background-color: #3994EE;
			text-align: center;
		}
		
		.div1 {
			background-image: url(img/1.png);
			width: 118px;
			height: 60px;
			color: #F6F6F6;
			float: left;
		}
		
		.div1:hover {
			background-image: url(img/2.png);
		}
		
		.div1:active {
			background-image: url(img/3.png);
		}
		
		a {
			text-decoration: none;
		}
		
		.div2 {
			height: 1px;
		}
		
		.div3 {
			border: #0CF solid 2px;
			height: 600px;
			margin-top: 65px;
			background-color: #E7FEED;
		}
		
		.div3_left {
			padding: 0px;
			margin: 0px;
			float: left;
			list-style: none;
		}
		
		.table {
			margin: auto;
		}
		
		.input1 {
			background-color: #EEA6AD;
		}
	</style>

	<body>
		<div id="AddStation">
			<div class="div2">
				<table width="354" border="0" cellspacing="0" cellpadding="0">
					<tr>
						<td width="118">
							<a href="gwgl1.html">
								<div class="div1" style=" background-color:#F90">
									<h4 style="text-align:center; line-height:0"> 增加岗位</h4>
								</div>
							</a>
						</td>
						<td width="118">
							<a href="gwgl2.html">
								<div class="div1">
									<h4 style="text-align:center; line-height:0"> 查询岗位</h4>
								</div>
							</a>
						</td>
						<td width="118">
							<a href="gwgl3.html">
								<div class="div1">
									<h4 style="text-align:center; line-height:0"> 查询岗位员工</h4>
								</div>
							</a>
						</td>
					</tr>
				</table>
			</div>
			<div class="div3" align="center">
				<h1>岗位信息填写</h1>
				<div>
					<form onsubmit="return false;">
						<table width="509px" height="150px" border="0" cellspacing="0" cellpadding="0">
							<tr>
								<td width="122" rowspan="5">&nbsp;</td>
								<td width="80" height="31" align="right" valign="middle">岗位编号：</td>
								<td width="185" align="left" valign="middle">
									<input type="text" v-model="station_id" />
									<font color="#FF0000">*</font>
								</td>
								<td width="122">
									<font color="#FF0000" size="-1">注意：" * "为必填项</font>
								</td>
							</tr>
							<tr>
								<td height="29" align="right" valign="middle">岗位名称：</td>
								<td align="left" valign="middle">
									<input type="text" v-model="station_name" />
									<font color="#FF0000">*</font>
								</td>
								<td width="122">
									<font id="font" color="#FF0000" size="-1"></font>
								</td>
							</tr>
							<tr>
								<td height="29" align="right" valign="middle">岗位类型：</td>
								<td align="left" valign="middle">
									<select v-model="station_type" >
										<option value="管理">管理</option>
										<option value="技术">技术</option>
										<option value="营销">营销</option>
										<option value="市场">市场</option>
										<option value="其他">其他</option>
									</select>
									<font color="#FF0000">*</font>
								</td>
								<td>&nbsp;</td>
							</tr>
							<tr>
								<td height="29" align="right" valign="middle">岗位编制：</td>
								<td align="left" valign="middle">
									<input type="text" v-model="station_num" /></td>
								<td>&nbsp;</td>
							</tr>
							<tr>
								<td height="30" align="right" valign="bottom">&nbsp;</td>
								<td align="left" valign="bottom">
									<input type="button" @click="addStation()" value="提交" />
									<input type="reset" value="重置" /></td>
								<td>&nbsp;</td>
							</tr>
						</table>
						<h3 style="color:red;"></h3>
					</form>
				</div>
			</div>
		</div>
		</div>

		<script src="../js/axios.js"></script>
		<script src="../js/vue.js"></script>
		<script src="../js/jquery.js"></script>
		<script>
			axios.defaults.baseURL = "http://176.55.4.113"
			const AddStation = new Vue({
				el: "#AddStation",
				data: {
					station_id: '',
					station_name: '',
					station_type: '管理',
					station_num: ''
				},
				methods: {
					addStation() {
						axios.post("/station/add", {
								station_id: this.station_id,
								station_name: this.station_name,
								station_type: this.station_type,
								station_num: this.station_num
							})
							.then(result => {
								console.log(result)
								if(result.data.status == 200){
									alert("添加成功")
								}else{
									alert("添加失败")
								}
							})
					}
				}
			})
		</script>
	</body>

</html>